#ifndef		Game__ITank_h
#define		Game__ITank_h

#include	"Helper.h"
#include	"Shell.h"
#include	"ShellList.h"
#include	<Math/Vector.h>
#include	<OpenGL/Color.h>

class Map;

class ITank
{
public:
	ITank();
	virtual void update(double delay) = 0;
	virtual bool isPlayer() const = 0;
	void render() const;
	void setShellList(ShellList * shellList);
	void setMap(Map * map);
	const Vector2i & getPos() const;
	void setPos(const Vector2i & pos = Vector2i(-1, -1));
	bool isColliding(const Vector2f & pos) const;
	bool isDead() const;
	int getLife() const;
	void setLife(int life);
	void destroy();
protected:
	bool checkWall(Facing facing) const;
	void shoot();
protected:
	Facing m_facing;
	Vector2i m_pos;
	float m_distance;
	float m_speed;
	float m_lastShot;
	Map * m_map;
	ShellList * m_shellList;
	Color m_color;
	int m_life;
public:
	static const float DEFAULT_SPEED;
	static const float SHOT_SPEED;
	static const float EPSILON;
};

#endif // Game__ITank_h

